package com.yoosora.common.mode.request;

import com.yoosora.common.mode.ToString;

/**
 * @author yoosora
 */
public class IDQueryRequest<T> extends ToString {
	private static final long serialVersionUID = 145508199253065202L;
	private T id;

	public IDQueryRequest() {
	}

	public IDQueryRequest(T id) {
		this.id = id;
	}

	public T getId() {
		return this.id;
	}

	public void setId(T id) {
		this.id = id;
	}

	@Override
	public String toString() {
		return "IDQueryRequest(id=" + this.getId() + ")";
	}

	@Override
	public boolean equals(Object o) {
		if (o == this) {
			return true;
		} else if (!(o instanceof IDQueryRequest)) {
			return false;
		} else {
			IDQueryRequest<?> other = (IDQueryRequest)o;
			if (!other.canEqual(this)) {
				return false;
			} else {
				Object this$id = this.getId();
				Object other$id = other.getId();
				if (this$id == null) {
					if (other$id != null) {
						return false;
					}
				} else if (!this$id.equals(other$id)) {
					return false;
				}

				return true;
			}
		}
	}

	protected boolean canEqual(Object other) {
		return other instanceof IDQueryRequest;
	}

	@Override
	public int hashCode() {
		int result = 1;
		Object $id = this.getId();
		result = result * 59 + ($id == null ? 43 : $id.hashCode());
		return result;
	}
}
